home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / Power.a < prev    next >
Encoding:
Text File  |  1996-05-01  |  40.1 KB  |  1,607 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Power.a
  3. ;
  4. ;    Contains:    Power Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__POWER__') = 'UNDEFINED' THEN
  19. __POWER__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  25.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  26.     include 'MixedMode.a'
  27.     ENDIF
  28.     ENDIF
  29.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  30.     IF &TYPE('__KERNEL__') = 'UNDEFINED' THEN
  31.     include 'Kernel.a'
  32.     ENDIF
  33.     IF &TYPE('__NAMEREGISTRY__') = 'UNDEFINED' THEN
  34.     include 'NameRegistry.a'
  35.     ENDIF
  36.     ENDIF
  37.     IF FOR_SYSTEM8_PREEMPTIVE THEN
  38. ;
  39. ;========================================================================================
  40. ;
  41. ;    The top of this file contains the Power Management interfaces used in Copland.
  42. ;    
  43. ;    The pre-Copland interfaces are below right after a large and obnoxious comment.
  44. ;
  45. ;========================================================================================
  46. ;
  47. ;
  48. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  49. ;
  50. ;    Low level (I/O architecture) interface
  51. ;    
  52. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  53. ;
  54. ;
  55. ;//------------------------------------------------------------------------------------
  56. ;
  57. ;    Power Management usage monitoring.
  58. ;
  59. ;    High level families call PMMonitorUsage for each hardware device they maintain.
  60. ;    Power management will periodically send messages to the family requesting the
  61. ;    current UsageCount for each device.
  62. ;    If power management determines that a device is idle it may be taken off-line.
  63. ;    Prior to doing so power managment will send a message instructing the family to
  64. ;    prepare for the device being off-line. When the device is reqired again the family
  65. ;    uses PMPrepareDevice to instruct power management to bring the device back on-line.
  66. ;
  67. ;//------------------------------------------------------------------------------------
  68. ;
  69. ; typedef UInt32                         PMUsageCount
  70.  
  71.  
  72.  
  73. ;
  74. ; extern OSStatus PMMonitorUsage(RegEntryRef *deviceToBeMonitored, ObjectID adminMessageObject, void *refCon, PMMonitorRef *newRef)
  75. ;
  76.     IF GENERATINGCFM THEN
  77.         IMPORT_CFM_FUNCTION PMMonitorUsage
  78.     ENDIF
  79.  
  80. ;
  81. ; extern OSStatus PMStopMonitoring(PMMonitorRef ref)
  82. ;
  83.     IF GENERATINGCFM THEN
  84.         IMPORT_CFM_FUNCTION PMStopMonitoring
  85.     ENDIF
  86.  
  87. ;
  88. ;//------------------------------------------------------------------------------------
  89. ;
  90. ;    Device Power State Management
  91. ;    
  92. ;    If a family maintains a device which is capable of switching between multiple
  93. ;    power states, the family should inform power management of the device's
  94. ;    capabilities and wait for messages directing it to change the device's power
  95. ;    state.
  96. ;
  97. ;//------------------------------------------------------------------------------------
  98. ;
  99.  
  100. kPMDeviceDescriptionInitialVersion EQU    1
  101. ; typedef OSType                         PMDeviceStateID
  102.  
  103. ; typedef UInt32                         PMDeviceStateFlags
  104.  
  105.  
  106. kPMDevicePoweredMask            EQU        $0001                ; device powered vs. not 
  107. kPMDeviceConfiguredMask            EQU        $0002                ; internal configuration retained vs. not 
  108. kPMDeviceUsableMask                EQU        $0004                ; "on-line" vs "off-line" (usable or not) 
  109. kPMDevicePowerLowestMask        EQU        $0100                ; set for device's highest state 
  110. kPMDevicePowerHighestMask        EQU        $0200                ; set for device's lowest state 
  111. PMDeviceState            RECORD 0
  112. id                         ds.l    1                ; offset: $0 (0)        ;  state identifier - not interpreted by power management 
  113. relativeConsumption         ds.l    1                ; offset: $4 (4)        ;  relative ranking of power consumption 
  114. flags                     ds.l    1                ; offset: $8 (8)        ;  one or more of the bits defined above 
  115. sizeof                     EQU *                    ; size:   $C (12)
  116.                         ENDR
  117. PMDeviceDescriptionHdr    RECORD 0
  118. version                     ds.l    1                ; offset: $0 (0)
  119. numberOfStates             ds.l    1                ; offset: $4 (4)
  120. sizeof                     EQU *                    ; size:   $8 (8)
  121.                         ENDR
  122. PMDeviceDescription        RECORD 0
  123. header                     ds        PMDeviceDescriptionHdr ; offset: $0 (0)
  124. states                     ds.b    2 * PMDeviceState.sizeof ; offset: $8 (8)
  125. sizeof                     EQU *                    ; size:   $20 (32)
  126.                         ENDR
  127.  
  128.  
  129. ;
  130. ; extern OSStatus PMManageDeviceState(RegEntryRef *deviceToBeManaged, ObjectID adminMessageObject, PMDeviceDescription *deviceStates, ByteCount descriptionSize, PMDeviceStateID currentState, void *refCon, PMManageRef *newRef)
  131. ;
  132.     IF GENERATINGCFM THEN
  133.         IMPORT_CFM_FUNCTION PMManageDeviceState
  134.     ENDIF
  135.  
  136. ;
  137. ; extern OSStatus PMNewDeviceState(PMManageRef manageRef, PMDeviceDescription *newStates, ByteCount stateSize, PMDeviceStateID currentState)
  138. ;
  139.     IF GENERATINGCFM THEN
  140.         IMPORT_CFM_FUNCTION PMNewDeviceState
  141.     ENDIF
  142.  
  143. ;
  144. ; extern OSStatus PMStopManaging(PMManageRef ref)
  145. ;
  146.     IF GENERATINGCFM THEN
  147.         IMPORT_CFM_FUNCTION PMStopManaging
  148.     ENDIF
  149.  
  150. ;
  151. ;//------------------------------------------------------------------------------------
  152. ;
  153. ;    Power Management notification.
  154. ;    
  155. ;    Any entity in the I/O architecture can use these routines to be notified about
  156. ;    changes to device.
  157. ;    
  158. ;    Clients use a mask to specify which device aspects they are interested in and
  159. ;    also to specify when to be notified. Flags describing the new state are generated
  160. ;    and delivered with the notification.
  161. ;    
  162. ;    If the client is interested in power being removed and re-applied, they can request
  163. ;    it with (kPMNotifyAlwaysMask | kPMNotifyPowerMask). When the notification is 
  164. ;    delivered the client can check the new flags against kPMNotifyBeforeMask and
  165. ;    kPMNotifyAfterMask to determine if the change has already occured or not. And can
  166. ;    check against kPMDevicePoweredMask to determine if the device will have power or
  167. ;    not in the new state.
  168. ;    
  169. ;//------------------------------------------------------------------------------------
  170. ;
  171. ; typedef UInt32                         PMNotifyFlags
  172.  
  173.  
  174. kPMNotifyPowerMask                EQU        $00000001
  175. kPMNotifyConfigurationMask        EQU        $00000002
  176. kPMNotifyUsabilityMask            EQU        $00000004
  177. kPMNotifyAllMask                EQU        $00000007
  178. kPMNotifyBeforeMask                EQU        $40000000            ; notification sent before change 
  179. kPMNotifyAfterMask                EQU        $80000000            ; notification sent after change 
  180. kPMNotifyAlwaysMask                EQU        $C0000000            ; notification sent before and after 
  181.  
  182.  
  183. ;
  184. ; extern OSStatus PMNotifyStateChange(RegEntryRef *interestingDevice, ObjectID adminMessageObject, PMNotifyFlags notifyFlags, void *refCon, PMNotifyRef *newRef)
  185. ;
  186.     IF GENERATINGCFM THEN
  187.         IMPORT_CFM_FUNCTION PMNotifyStateChange
  188.     ENDIF
  189.  
  190. ;
  191. ; extern OSStatus PMStopNotification(PMNotifyRef ref)
  192. ;
  193.     IF GENERATINGCFM THEN
  194.         IMPORT_CFM_FUNCTION PMStopNotification
  195.     ENDIF
  196.  
  197. ;
  198. ;//------------------------------------------------------------------------------------
  199. ;
  200. ;    Power Management message
  201. ;    
  202. ;    This structure is used for all types of power management communication - usage
  203. ;    monitoring, state change notification, and state change commands.
  204. ;
  205. ;//------------------------------------------------------------------------------------
  206. ;
  207.  
  208. kPMRetrieveUsageCountMessage    EQU        1
  209. kPMChangeDeviceStateMessage        EQU        2
  210. kPMNotifyStateChangeMessage        EQU        3
  211. PMMessageData            RECORD 0
  212. newStateFlags             ds.l    1                ; offset: $0 (0)        ;  used in kPMNotifyStateChangeMessage 
  213.                          ORG 0
  214. targetState                 ds.l    1                ; offset: $0 (0)        ;  used in kChangeDeviceStateMessage 
  215. sizeof                     EQU *                    ; size:   $4 (4)
  216.                         ENDR
  217. PMMessage                RECORD 0
  218. ampReserved                 ds.l    1                ; offset: $0 (0)        ;  reserved for use by AdminMessagePort service 
  219. messageCode                 ds.l    1                ; offset: $4 (4)        ;  one of the message codes above 
  220. refCon                     ds.l    1                ; offset: $8 (8)        ;  
  221. data                     ds        PMMessageData    ; offset: $C (12)        ;  message-specific extra data 
  222. sizeof                     EQU *                    ; size:   $10 (16)
  223.                         ENDR
  224. ;
  225. ;//------------------------------------------------------------------------------------
  226. ;
  227. ;    Restoring an off-line or powered off device to a usable state.
  228. ;    
  229. ;    When a device that has been taken off-line or has had its power removed is needed
  230. ;    again, the following routine should be called. This routine will return when after
  231. ;    the device has been restored (or has failed to be restored). Part of the restoration
  232. ;    process is delivering notifications to interested parties - kPMPowerRestore and/or
  233. ;    kPMPrepareOnLine messages will be delivered and processed before this routine 
  234. ;    returns.
  235. ;
  236. ;//------------------------------------------------------------------------------------
  237. ;
  238. ;
  239. ; extern OSStatus PMMakeDeviceUsable(RegEntryRef *whichDevice)
  240. ;
  241.     IF GENERATINGCFM THEN
  242.         IMPORT_CFM_FUNCTION PMMakeDeviceUsable
  243.     ENDIF
  244.  
  245. ;
  246. ;//------------------------------------------------------------------------------------
  247. ;
  248. ;    Disabling & Re-Enabling power managment of a device.
  249. ;    
  250. ;    Power management of a specific device can be disabled - this may be desirable
  251. ;    because of a resource reservation on some device. 
  252. ;    Families can implement a family specific API on top of this that can allow
  253. ;    an application to turn off power management for a particular volume or display
  254. ;    device.
  255. ;    
  256. ;    When power management of some device is disabled usage monitoring will still
  257. ;    occur, but there will not be any requests to change the device state. The
  258. ;    domain of which the device is a member will not be changed either.
  259. ;
  260. ;//------------------------------------------------------------------------------------
  261. ;
  262. ;
  263. ; extern OSStatus PMDisablePowerManagement(RegEntryRef *whichDevice)
  264. ;
  265.     IF GENERATINGCFM THEN
  266.         IMPORT_CFM_FUNCTION PMDisablePowerManagement
  267.     ENDIF
  268.  
  269. ;
  270. ; extern OSStatus PMEnablePowerManagement(RegEntryRef *whichDevice)
  271. ;
  272.     IF GENERATINGCFM THEN
  273.         IMPORT_CFM_FUNCTION PMEnablePowerManagement
  274.     ENDIF
  275.  
  276. ;
  277. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  278. ;
  279. ;    Domain Controller Power Management Plug-In interface.
  280. ;
  281. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  282. ;
  283. ;
  284. ;//------------------------------------------------------------------------------------
  285. ;
  286. ;    Domain description
  287. ;
  288. ;//------------------------------------------------------------------------------------
  289. ;
  290.  
  291. kPMDomainDescriptionInitialVersion EQU    1
  292. ; typedef OSType                         PMDomainID
  293.  
  294. ; typedef OSType                         PMDomainLevelID
  295.  
  296. ; typedef UInt32                         PMDomainLevelFlags
  297.  
  298.  
  299. kPMDomainOffMask                EQU        $0000
  300. kPMDomainFreezeMask                EQU        $0003
  301. kPMDomainReducedMask            EQU        $0007
  302. kPMDomainFullMask                EQU        $0207
  303. PMDomainLevel            RECORD 0
  304. levelID                     ds.l    1                ; offset: $0 (0)
  305. flags                     ds.l    1                ; offset: $4 (4)
  306. sizeof                     EQU *                    ; size:   $8 (8)
  307.                         ENDR
  308. PMDomainDescriptionHdr    RECORD 0
  309. descriptionVersion         ds.l    1                ; offset: $0 (0)
  310. domainID                 ds.l    1                ; offset: $4 (4)
  311. numberOfLevels             ds.l    1                ; offset: $8 (8)
  312. sizeof                     EQU *                    ; size:   $C (12)
  313.                         ENDR
  314. PMDomainDescription        RECORD 0
  315. header                     ds        PMDomainDescriptionHdr ; offset: $0 (0)
  316. levels                     ds.b    2 * PMDomainLevel.sizeof ; offset: $C (12)
  317. sizeof                     EQU *                    ; size:   $1C (28)
  318.                         ENDR
  319. ;
  320. ;//------------------------------------------------------------------------------------
  321. ;
  322. ;    Domain plugin. 
  323. ;    Plugin init routine returns pointer to a domain description as an out parameter.
  324. ;
  325. ;//------------------------------------------------------------------------------------
  326. ;
  327.  
  328. kPMDomainPluginVersion            EQU        $01000000
  329. PMDomainPluginDispatchTable RECORD 0
  330. version                     ds.l    1                ; offset: $0 (0)
  331. reserved                 ds.l    3                ; offset: $4 (4)
  332. init                     ds.l    1                ; offset: $10 (16)
  333. setLevel                 ds.l    1                ; offset: $14 (20)
  334. sizeof                     EQU *                    ; size:   $18 (24)
  335.                         ENDR
  336. ;
  337. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  338. ;
  339. ;    Platform plugin.
  340. ;    
  341. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  342. ;
  343.  
  344. kPMPlatformPluginVersion        EQU        $01000000
  345. PMPlatformPlugin        RECORD 0
  346. version                     ds.l    1                ; offset: $0 (0)
  347. reserved                 ds.l    3                ; offset: $4 (4)
  348. sleep                     ds.l    1                ; offset: $10 (16)
  349. hibernate                 ds.l    1                ; offset: $14 (20)
  350. shutdown                 ds.l    1                ; offset: $18 (24)
  351. restart                     ds.l    1                ; offset: $1C (28)
  352. sizeof                     EQU *                    ; size:   $20 (32)
  353.                         ENDR
  354. ;
  355. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  356. ;
  357. ;    High level (application) interface.
  358. ;    
  359. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  360. ;
  361. ;
  362. ;    Disk timer: the time a disk must be idle before it is spun down (or other
  363. ;    power management actions are taken). Applies to all disks, but each disk
  364. ;    has its own timer (one can stay spun up while the others are spun down).
  365. ;    
  366. ;    The minimum will be enforced.
  367. ;    
  368. ;    These API control system-wide parameters for the power management of disk devices.
  369. ;    For control over a specific disk see the <Block Storage or File System> API.
  370. ;    
  371. ;    
  372. ;
  373.  
  374. kPMDiskSpinDownDisabled            EQU        0
  375. ;
  376. ; extern OSStatus PMSetDiskSpinDownTimeout(UInt32 seconds)
  377. ;
  378.     IF GENERATINGCFM THEN
  379.         IMPORT_CFM_FUNCTION PMSetDiskSpinDownTimeout
  380.     ENDIF
  381.  
  382. ;
  383. ; extern UInt32 PMGetDiskSpinDownTimeout(void )
  384. ;
  385.     IF GENERATINGCFM THEN
  386.         IMPORT_CFM_FUNCTION PMGetDiskSpinDownTimeout
  387.     ENDIF
  388.  
  389. ;
  390. ; extern UInt32 PMGetMinimumDiskSpinDownTimeout(void )
  391. ;
  392.     IF GENERATINGCFM THEN
  393.         IMPORT_CFM_FUNCTION PMGetMinimumDiskSpinDownTimeout
  394.     ENDIF
  395.  
  396. ;
  397. ;    Display timer: the period of time in which there has been no user input
  398. ;    before a display is dimmed or turned off. Applies to all displays, but
  399. ;    each display has its own timer.
  400. ;    
  401. ;    The minimum will be enforced.
  402. ;
  403.  
  404. kPMDisplayDimmingDisabled        EQU        0
  405. ;
  406. ; extern OSStatus PMSetDisplayDimmingTimeout(UInt32 seconds)
  407. ;
  408.     IF GENERATINGCFM THEN
  409.         IMPORT_CFM_FUNCTION PMSetDisplayDimmingTimeout
  410.     ENDIF
  411.  
  412. ;
  413. ; extern UInt32 PMGetDisplayDimmingTimeout(void )
  414. ;
  415.     IF GENERATINGCFM THEN
  416.         IMPORT_CFM_FUNCTION PMGetDisplayDimmingTimeout
  417.     ENDIF
  418.  
  419. ;
  420. ; extern UInt32 PMGetMinimumDisplayDimmingTimeout(void )
  421. ;
  422.     IF GENERATINGCFM THEN
  423.         IMPORT_CFM_FUNCTION PMGetMinimumDisplayDimmingTimeout
  424.     ENDIF
  425.  
  426. ;
  427. ;    Idle state timer: the period of time in which all devices must be idle 
  428. ;    before the system is [?]. Basically, this is the timer for whatever action 
  429. ;    the user chose to happen when the system is idle. Could be sleep, hibernate,
  430. ;    or shutdown. If the user has explicitly disabled any action the    routines 
  431. ;    return an error.
  432. ;    
  433. ;    The minimum will be enforced and will be greater than or equal to the
  434. ;    maximum of disk spin down and display dimming times.
  435. ;
  436.  
  437. kPMIdleStateDisabled            EQU        0
  438. ;
  439. ; extern OSStatus PMSetIdleStateTimeout(UInt32 seconds)
  440. ;
  441.     IF GENERATINGCFM THEN
  442.         IMPORT_CFM_FUNCTION PMSetIdleStateTimeout
  443.     ENDIF
  444.  
  445. ;
  446. ; extern UInt32 PMGetIdleStateTimeout(void )
  447. ;
  448.     IF GENERATINGCFM THEN
  449.         IMPORT_CFM_FUNCTION PMGetIdleStateTimeout
  450.     ENDIF
  451.  
  452. ;
  453. ; extern UInt32 PMGetMinimumIdleStateTimeout(void )
  454. ;
  455.     IF GENERATINGCFM THEN
  456.         IMPORT_CFM_FUNCTION PMGetMinimumIdleStateTimeout
  457.     ENDIF
  458.  
  459. ;
  460. ;    Idle state: routines to get and set the action to be taken when power
  461. ;    management has determined that the system is idle.
  462. ;        Disabled: nothing happens when the machine is idle
  463. ;        Sleep is a soft definition - depends on the hardware: differs 
  464. ;        between portable and desktop systems.
  465. ;        Hibernate: save everthing and shutdown, on boot reload the saved
  466. ;        state.
  467. ;        Shutdown: just shutdown, nothing restored on boot.
  468. ;
  469.  
  470. kPMIdleStateKindShutdown        EQU        1
  471. kPMIdleStateKindHibernate        EQU        2
  472. kPMIdleStateKindSleep            EQU        3
  473. ;
  474. ; extern OSStatus PMSetIdleStateKind(UInt32 idleStateKind)
  475. ;
  476.     IF GENERATINGCFM THEN
  477.         IMPORT_CFM_FUNCTION PMSetIdleStateKind
  478.     ENDIF
  479.  
  480. ;
  481. ; extern UInt32 PMGetIdleStateKind(void )
  482. ;
  483.     IF GENERATINGCFM THEN
  484.         IMPORT_CFM_FUNCTION PMGetIdleStateKind
  485.     ENDIF
  486.  
  487. ;
  488. ;    Misc. timers: These allow for programmable shutdown and power on. These are 
  489. ;    real absolute times - turn off at 6:00pm Jan 12 and back on at 8:00am Feb 1. 
  490. ;    The 'DateAndTimeSpec' is a made-up placeholder.
  491. ;    
  492. ;    Shutdown is a real shutdown.
  493. ;    IdleAction puts the machine into the chosen idle state - if the machine is
  494. ;    shutdown at the that time nothing happens.
  495. ;    PowerOn is either a normal boot or a return-from-idle depending on whether
  496. ;    the system is shutdown or is in its idle state.
  497. ;
  498. ;
  499. ; extern OSStatus PMSetShutdownTime(ConstTimeObjectPtr when)
  500. ;
  501.     IF GENERATINGCFM THEN
  502.         IMPORT_CFM_FUNCTION PMSetShutdownTime
  503.     ENDIF
  504.  
  505. ;
  506. ; extern OSStatus PMGetShutdownTime(TimeObjectPtr when)
  507. ;
  508.     IF GENERATINGCFM THEN
  509.         IMPORT_CFM_FUNCTION PMGetShutdownTime
  510.     ENDIF
  511.  
  512. ;
  513. ; extern OSStatus PMSetIdleStateTime(ConstTimeObjectPtr when)
  514. ;
  515.     IF GENERATINGCFM THEN
  516.         IMPORT_CFM_FUNCTION PMSetIdleStateTime
  517.     ENDIF
  518.  
  519. ;
  520. ; extern OSStatus PMGetIdleStateTime(TimeObjectPtr when)
  521. ;
  522.     IF GENERATINGCFM THEN
  523.         IMPORT_CFM_FUNCTION PMGetIdleStateTime
  524.     ENDIF
  525.  
  526. ;
  527. ; extern OSStatus PMSetPowerOnTime(ConstTimeObjectPtr when)
  528. ;
  529.     IF GENERATINGCFM THEN
  530.         IMPORT_CFM_FUNCTION PMSetPowerOnTime
  531.     ENDIF
  532.  
  533. ;
  534. ; extern OSStatus PMGetPowerOnTime(TimeObjectPtr when)
  535. ;
  536.     IF GENERATINGCFM THEN
  537.         IMPORT_CFM_FUNCTION PMGetPowerOnTime
  538.     ENDIF
  539.  
  540. ;     Immediate control over system state
  541. ;
  542. ; extern OSStatus PMRestart(void )
  543. ;
  544.     IF GENERATINGCFM THEN
  545.         IMPORT_CFM_FUNCTION PMRestart
  546.     ENDIF
  547.  
  548. ;
  549. ; extern OSStatus PMEnterIdleState(UInt32 idleStateKind)
  550. ;
  551.     IF GENERATINGCFM THEN
  552.         IMPORT_CFM_FUNCTION PMEnterIdleState
  553.     ENDIF
  554.  
  555. ;
  556. ;//------------------------------------------------------------------------------------
  557. ;
  558. ;    Other high level API.
  559. ;    
  560. ;    Other families may want to implement their own power management API that is built
  561. ;    on top of the API presented here. Examples are the ability to turn off power
  562. ;    management of a specific storage volume or a specific graphics display. The battery
  563. ;    family will want/need to export a high level API that can show battery state.
  564. ;
  565. ;//------------------------------------------------------------------------------------
  566. ;
  567. ;
  568. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  569. ;
  570. ;    User activity monitoring.
  571. ;    
  572. ;    These routine are used by software that is interested in the lack of and resumption
  573. ;    of user activity. The usage model is as follows: software requests to be notified
  574. ;    when all user activity has ceased for a specified amount of time. Once that
  575. ;    notification has been delivered any user activity will cause the second notification
  576. ;    to be delivered immediately. After delivery of the resume notification, the reference
  577. ;    is invalid and software must request notification again if it so desires.
  578. ;    
  579. ;//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  580. ;
  581.  
  582.  
  583. ;
  584. ; extern OSStatus PMMonitorUserActivity(UInt32 minutesIdle, KernelNotification *howToNotifyIdle, KernelNotification *howToNotifyResume, PMUserMonitorRef *newRef)
  585. ;
  586.     IF GENERATINGCFM THEN
  587.         IMPORT_CFM_FUNCTION PMMonitorUserActivity
  588.     ENDIF
  589.  
  590. ;
  591. ; extern OSStatus PMCancelMonitoring(PMUserMonitorRef refToCancel)
  592. ;
  593.     IF GENERATINGCFM THEN
  594.         IMPORT_CFM_FUNCTION PMCancelMonitoring
  595.     ENDIF
  596.  
  597.     ENDIF
  598. ;
  599. ;••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  600. ;
  601. ;
  602. ;    Everything below this comment is the System 7.x Power Manager
  603. ;    
  604. ;    This comment is really large and obnoxious so that the separation can be easily
  605. ;    found when scrolling through the file.
  606. ;
  607. ;
  608. ;••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  609. ;
  610.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  611.  
  612.                                                             ; Bit positions for ModemByte 
  613. modemOnBit                        EQU        0
  614. ringWakeUpBit                    EQU        2
  615. modemInstalledBit                EQU        3
  616. ringDetectBit                    EQU        4
  617. modemOnHookBit                    EQU        5                    ; masks for ModemByte 
  618. modemOnMask                        EQU        $01
  619. ringWakeUpMask                    EQU        $04
  620. modemInstalledMask                EQU        $08
  621. ringDetectMask                    EQU        $10
  622. modemOnHookMask                    EQU        $20                    ; bit positions for BatteryByte 
  623. chargerConnBit                    EQU        0
  624. hiChargeBit                        EQU        1
  625. chargeOverFlowBit                EQU        2
  626. batteryDeadBit                    EQU        3
  627. batteryLowBit                    EQU        4
  628. connChangedBit                    EQU        5                    ; masks for BatteryByte 
  629. chargerConnMask                    EQU        $01
  630. hiChargeMask                    EQU        $02
  631. chargeOverFlowMask                EQU        $04
  632. batteryDeadMask                    EQU        $08
  633. batteryLowMask                    EQU        $10
  634. connChangedMask                    EQU        $20
  635.  
  636.                                                             ; commands to SleepQRec sleepQProc 
  637. sleepRequest                    EQU        1
  638. sleepDemand                        EQU        2
  639. sleepWakeUp                        EQU        3
  640. sleepRevoke                        EQU        4
  641. sleepUnlock                        EQU        4
  642. sleepDeny                        EQU        5
  643. sleepNow                        EQU        6
  644. dozeDemand                        EQU        7
  645. dozeWakeUp                        EQU        8
  646. dozeRequest                        EQU        9                    ; SleepQRec.sleepQFlags 
  647. noCalls                            EQU        1
  648. noRequest                        EQU        2
  649. slpQType                        EQU        16
  650. sleepQType                        EQU        16
  651. ;  bits in bitfield returned by PMFeatures 
  652.  
  653. hasWakeupTimer                    EQU        0                    ; 1=wakeup timer is supported                        
  654. hasSharedModemPort                EQU        1                    ; 1=modem port shared by SCC and internal modem    
  655. hasProcessorCycling                EQU        2                    ; 1=processor cycling is supported                    
  656. mustProcessorCycle                EQU        3                    ; 1=processor cycling should not be turned off        
  657. hasReducedSpeed                    EQU        4                    ; 1=processor can be started up at reduced speed    
  658. dynamicSpeedChange                EQU        5                    ; 1=processor speed can be switched dynamically    
  659. hasSCSIDiskMode                    EQU        6                    ; 1=SCSI Disk Mode is supported                    
  660. canGetBatteryTime                EQU        7                    ; 1=battery time can be calculated                    
  661. canWakeupOnRing                    EQU        8                    ; 1=can wakeup when the modem detects a ring        
  662. hasDimmingSupport                EQU        9                    ; 1=has dimming support built in                    
  663. hasStartupTimer                    EQU        10                    ; 1=startup timer is supported                        
  664. ;  bits in bitfield returned by GetIntModemInfo and set by SetIntModemState 
  665.  
  666. hasInternalModem                EQU        0                    ; 1=internal modem installed                        
  667. intModemRingDetect                EQU        1                    ; 1=internal modem has detected a ring                
  668. intModemOffHook                    EQU        2                    ; 1=internal modem is off hook                        
  669. intModemRingWakeEnb                EQU        3                    ; 1=wakeup on ring is enabled                        
  670. extModemSelected                EQU        4                    ; 1=external modem selected                        
  671. modemSetBit                        EQU        15                    ; 1=set bit, 0=clear bit (SetIntModemState)        
  672. ;  bits in BatteryInfo.flags                                     
  673. ;  ("chargerConnected" doesn't mean the charger is plugged in)    
  674.  
  675. batteryInstalled                EQU        7                    ; 1=battery is currently connected                    
  676. batteryCharging                    EQU        6                    ; 1=battery is being charged                        
  677. chargerConnected                EQU        5                    ; 1=charger is connected to the PowerBook            
  678.  
  679. HDPwrQType                        EQU        $4844                ; 'HD' hard disk spindown queue element type            
  680. PMgrStateQType                    EQU        $504D                ; 'PM' Power Manager state queue element type            
  681. ;  client notification bits in PMgrQueueElement.pmNotifyBits 
  682.  
  683. pmSleepTimeoutChanged            EQU        0
  684. pmSleepEnableChanged            EQU        1
  685. pmHardDiskTimeoutChanged        EQU        2
  686. pmHardDiskSpindownChanged        EQU        3
  687. pmDimmingTimeoutChanged            EQU        4
  688. pmDimmingEnableChanged            EQU        5
  689. pmDiskModeAddressChanged        EQU        6
  690. pmProcessorCyclingChanged        EQU        7
  691. pmProcessorSpeedChanged            EQU        8
  692. pmWakeupTimerChanged            EQU        9
  693. pmStartupTimerChanged            EQU        10
  694. pmHardDiskPowerRemovedbyUser    EQU        11
  695. ;  System Activity Selectors 
  696.  
  697. OverallAct                        EQU        0                    ; general type of activity                            
  698. UsrActivity                        EQU        1                    ; user specific type of activity                    
  699. NetActivity                        EQU        2                    ; network specific activity                        
  700. HDActivity                        EQU        3                    ; Hard Drive activity                                
  701. ;  Storage Media sleep mode defines 
  702.  
  703. kMediaModeOn                    EQU        0                    ; Media active (Drive spinning and at full power)    
  704. kMediaModeStandBy                EQU        1                    ; Media standby (not implemented)    
  705. kMediaModeSuspend                EQU        2                    ; Media Idle (not implemented)    
  706. kMediaModeOff                    EQU        3                    ; Media Sleep (Drive not spinning and at min power, max recovery time)    
  707.  
  708. kMediaPowerCSCode                EQU        70
  709. ActivityInfo            RECORD 0
  710. ActivityType             ds.w    1                ; offset: $0 (0)        ;  Type of activity to be fetched.  Same as UpdateSystemActivity Selectors 
  711. ActivityTime             ds.l    1                ; offset: $2 (2)        ;  Time of last activity (in ticks) of specified type. 
  712. sizeof                     EQU *                    ; size:   $6 (6)
  713.                         ENDR
  714. ;  information returned by GetScaledBatteryInfo 
  715. BatteryInfo                RECORD 0
  716. flags                     ds.b    1                ; offset: $0 (0)        ;  misc flags (see below)                            
  717. warningLevel             ds.b    1                ; offset: $1 (1)        ;  scaled warning level (0-255)                        
  718. reserved                 ds.b    1                ; offset: $2 (2)        ;  reserved for internal use                        
  719. batteryLevel             ds.b    1                ; offset: $3 (3)        ;  scaled battery level (0-255)                        
  720. sizeof                     EQU *                    ; size:   $4 (4)
  721.                         ENDR
  722. ; typedef SInt8                         ModemByte
  723.  
  724. ; typedef SInt8                         BatteryByte
  725.  
  726. ; typedef long                             PMResultCode
  727.  
  728.  
  729.  
  730. ; typedef SleepQRec *                    SleepQRecPtr
  731.  
  732.  
  733.  
  734.  
  735.  
  736. SleepQRec                RECORD 0
  737. sleepQLink                 ds.l    1                ; offset: $0 (0)        ;  pointer to next queue element                
  738. sleepQType                 ds.w    1                ; offset: $4 (4)        ;  queue element type (must be SleepQType)        
  739. sleepQProc                 ds.l    1                ; offset: $6 (6)        ;  pointer to sleep universal proc ptr            
  740. sleepQFlags                 ds.w    1                ; offset: $A (10)        ;  flags                                        
  741. sizeof                     EQU *                    ; size:   $C (12)
  742.                         ENDR
  743. HDQueueElement            RECORD 0
  744. hdQLink                     ds.l    1                ; offset: $0 (0)        ;  pointer to next queue element                
  745. hdQType                     ds.w    1                ; offset: $4 (4)        ;  queue element type (must be HDPwrQType)        
  746. hdFlags                     ds.w    1                ; offset: $6 (6)        ;  miscellaneous flags                            
  747. hdProc                     ds.l    1                ; offset: $8 (8)        ;  pointer to routine to call                    
  748. hdUser                     ds.l    1                ; offset: $C (12)        ;  user-defined (variable storage, etc.)        
  749. sizeof                     EQU *                    ; size:   $10 (16)
  750.                         ENDR
  751. PMgrQueueElement        RECORD 0
  752. pmQLink                     ds.l    1                ; offset: $0 (0)        ;  pointer to next queue element                
  753. pmQType                     ds.w    1                ; offset: $4 (4)        ;  queue element type (must be PMgrStateQType)    
  754. pmFlags                     ds.w    1                ; offset: $6 (6)        ;  miscellaneous flags                            
  755. pmNotifyBits             ds.l    1                ; offset: $8 (8)        ;  bitmap of which changes to be notified for    
  756. pmProc                     ds.l    1                ; offset: $C (12)        ;  pointer to routine to call                    
  757. pmUser                     ds.l    1                ; offset: $10 (16)        ;  user-defined (variable storage, etc.)        
  758. sizeof                     EQU *                    ; size:   $14 (20)
  759.                         ENDR
  760. BatteryTimeRec            RECORD 0
  761. expectedBatteryTime         ds.l    1                ; offset: $0 (0)        ;  estimated battery time remaining (seconds)    
  762. minimumBatteryTime         ds.l    1                ; offset: $4 (4)        ;  minimum battery time remaining (seconds)        
  763. maximumBatteryTime         ds.l    1                ; offset: $8 (8)        ;  maximum battery time remaining (seconds)        
  764. timeUntilCharged         ds.l    1                ; offset: $C (12)        ;  time until battery is fully charged (seconds)
  765. sizeof                     EQU *                    ; size:   $10 (16)
  766.                         ENDR
  767. WakeupTime                RECORD 0
  768. wakeTime                 ds.l    1                ; offset: $0 (0)        ;  wakeup time (same format as current time)        
  769. wakeEnabled                 ds.b    1                ; offset: $4 (4)        ;  1=enable wakeup timer, 0=disable wakeup timer    
  770. filler                     ds.b    1                ; offset: $5 (5)
  771. sizeof                     EQU *                    ; size:   $6 (6)
  772.                         ENDR
  773. StartupTime                RECORD 0
  774. startTime                 ds.l    1                ; offset: $0 (0)        ;  startup time (same format as current time)        
  775. startEnabled             ds.b    1                ; offset: $4 (4)        ;  1=enable startup timer, 0=disable startup timer    
  776. filler                     ds.b    1                ; offset: $5 (5)
  777. sizeof                     EQU *                    ; size:   $6 (6)
  778.                         ENDR
  779. ;
  780. ; pascal OSErr DisableWUTime(void )
  781. ;
  782.     IF GENERATINGCFM THEN
  783.         IMPORT_CFM_FUNCTION DisableWUTime
  784.     ENDIF
  785.  
  786. ;
  787. ; pascal OSErr SetWUTime(long WUTime)
  788. ;
  789.     IF GENERATINGCFM THEN
  790.         IMPORT_CFM_FUNCTION SetWUTime
  791.     ENDIF
  792.  
  793. ;
  794. ; pascal OSErr GetWUTime(long *WUTime, Byte *WUFlag)
  795. ;
  796.     IF GENERATINGCFM THEN
  797.         IMPORT_CFM_FUNCTION GetWUTime
  798.     ENDIF
  799.  
  800. ;
  801. ; pascal OSErr BatteryStatus(Byte *Status, Byte *Power)
  802. ;
  803.     IF GENERATINGCFM THEN
  804.         IMPORT_CFM_FUNCTION BatteryStatus
  805.     ENDIF
  806.  
  807. ;
  808. ; pascal OSErr ModemStatus(Byte *Status)
  809. ;
  810.     IF GENERATINGCFM THEN
  811.         IMPORT_CFM_FUNCTION ModemStatus
  812.     ENDIF
  813.  
  814. ;
  815. ; pascal long IdleUpdate(void )
  816. ;
  817.     IF ¬ GENERATINGCFM THEN
  818.         ; returns:
  819.         ;    long            <= D0
  820.         _IdleUpdate:    OPWORD    $A285
  821.     ELSE
  822.         IMPORT_CFM_FUNCTION IdleUpdate
  823.     ENDIF
  824.  
  825. ;
  826. ; pascal long GetCPUSpeed(void )
  827. ;
  828.     IF ¬ GENERATINGCFM THEN
  829.         ; returns:
  830.         ;    long            <= D0
  831.         Macro
  832.         _GetCPUSpeed
  833.             moveq               #-1,D0
  834.             dc.w                $A485
  835.         EndM
  836.     ELSE
  837.         IMPORT_CFM_FUNCTION GetCPUSpeed
  838.     ENDIF
  839.  
  840. ;
  841. ; pascal void EnableIdle(void )
  842. ;
  843.     IF ¬ GENERATINGCFM THEN
  844.         Macro
  845.         _EnableIdle
  846.             moveq               #0,D0
  847.             dc.w                $A485
  848.         EndM
  849.     ELSE
  850.         IMPORT_CFM_FUNCTION EnableIdle
  851.     ENDIF
  852.  
  853. ;
  854. ; pascal void DisableIdle(void )
  855. ;
  856.     IF ¬ GENERATINGCFM THEN
  857.         Macro
  858.         _DisableIdle
  859.             moveq               #1,D0
  860.             dc.w                $A485
  861.         EndM
  862.     ELSE
  863.         IMPORT_CFM_FUNCTION DisableIdle
  864.     ENDIF
  865.  
  866. ;
  867. ; pascal void SleepQInstall(SleepQRecPtr qRecPtr)
  868. ;
  869.     IF ¬ GENERATINGCFM THEN
  870.         ; parameters:
  871.         ;    qRecPtr         => A0
  872.         _SleepQInstall:    OPWORD    $A28A
  873.     ELSE
  874.         IMPORT_CFM_FUNCTION SleepQInstall
  875.     ENDIF
  876.  
  877. ;
  878. ; pascal void SleepQRemove(SleepQRecPtr qRecPtr)
  879. ;
  880.     IF ¬ GENERATINGCFM THEN
  881.         ; parameters:
  882.         ;    qRecPtr         => A0
  883.         _SleepQRemove:    OPWORD    $A48A
  884.     ELSE
  885.         IMPORT_CFM_FUNCTION SleepQRemove
  886.     ENDIF
  887.  
  888. ;
  889. ; pascal void AOn(void )
  890. ;
  891.     IF ¬ GENERATINGCFM THEN
  892.         Macro
  893.         _AOn
  894.             moveq               #4,D0
  895.             dc.w                $A685
  896.         EndM
  897.     ELSE
  898.         IMPORT_CFM_FUNCTION AOn
  899.     ENDIF
  900.  
  901. ;
  902. ; pascal void AOnIgnoreModem(void )
  903. ;
  904.     IF ¬ GENERATINGCFM THEN
  905.         Macro
  906.         _AOnIgnoreModem
  907.             moveq               #5,D0
  908.             dc.w                $A685
  909.         EndM
  910.     ELSE
  911.         IMPORT_CFM_FUNCTION AOnIgnoreModem
  912.     ENDIF
  913.  
  914. ;
  915. ; pascal void BOn(void )
  916. ;
  917.     IF ¬ GENERATINGCFM THEN
  918.         Macro
  919.         _BOn
  920.             moveq               #0,D0
  921.             dc.w                $A685
  922.         EndM
  923.     ELSE
  924.         IMPORT_CFM_FUNCTION BOn
  925.     ENDIF
  926.  
  927. ;
  928. ; pascal void AOff(void )
  929. ;
  930.     IF ¬ GENERATINGCFM THEN
  931.         Macro
  932.         _AOff
  933.             moveq               #-124,D0
  934.             dc.w                $A685
  935.         EndM
  936.     ELSE
  937.         IMPORT_CFM_FUNCTION AOff
  938.     ENDIF
  939.  
  940. ;
  941. ; pascal void BOff(void )
  942. ;
  943.     IF ¬ GENERATINGCFM THEN
  944.         Macro
  945.         _BOff
  946.             moveq               #-128,D0
  947.             dc.w                $A685
  948.         EndM
  949.     ELSE
  950.         IMPORT_CFM_FUNCTION BOff
  951.     ENDIF
  952.  
  953. ;  Public Power Management API (NEW!) 
  954. ;
  955. ; pascal short PMSelectorCount(void )
  956. ;
  957.     IF ¬ GENERATINGCFM THEN
  958.         ; returns:
  959.         ;    short           <= D0
  960.         Macro
  961.         _PMSelectorCount
  962.             moveq               #0,D0
  963.             dc.w                $A09E
  964.         EndM
  965.     ELSE
  966.         IMPORT_CFM_FUNCTION PMSelectorCount
  967.     ENDIF
  968.  
  969. ;
  970. ; pascal unsigned long PMFeatures(void )
  971. ;
  972.     IF ¬ GENERATINGCFM THEN
  973.         ; returns:
  974.         ;    unsigned long   <= D0
  975.         Macro
  976.         _PMFeatures
  977.             moveq               #1,D0
  978.             dc.w                $A09E
  979.         EndM
  980.     ELSE
  981.         IMPORT_CFM_FUNCTION PMFeatures
  982.     ENDIF
  983.  
  984. ;
  985. ; pascal UInt8 GetSleepTimeout(void )
  986. ;
  987.     IF ¬ GENERATINGCFM THEN
  988.         ; returns:
  989.         ;    UInt8           <= D0
  990.         Macro
  991.         _GetSleepTimeout
  992.             moveq               #2,D0
  993.             dc.w                $A09E
  994.         EndM
  995.     ELSE
  996.         IMPORT_CFM_FUNCTION GetSleepTimeout
  997.     ENDIF
  998.  
  999. ;
  1000. ; pascal void SetSleepTimeout(UInt8 timeout)
  1001. ;
  1002.     IF ¬ GENERATINGCFM THEN
  1003.         ; parameters:
  1004.         ;    timeout         => D0
  1005.         Macro
  1006.         _SetSleepTimeout
  1007.             swap                D0
  1008.             move.w              #$0003,D0
  1009.             dc.w                $A09E
  1010.         EndM
  1011.     ELSE
  1012.         IMPORT_CFM_FUNCTION SetSleepTimeout
  1013.     ENDIF
  1014.  
  1015. ;
  1016. ; pascal UInt8 GetHardDiskTimeout(void )
  1017. ;
  1018.     IF ¬ GENERATINGCFM THEN
  1019.         ; returns:
  1020.         ;    UInt8           <= D0
  1021.         Macro
  1022.         _GetHardDiskTimeout
  1023.             moveq               #4,D0
  1024.             dc.w                $A09E
  1025.         EndM
  1026.     ELSE
  1027.         IMPORT_CFM_FUNCTION GetHardDiskTimeout
  1028.     ENDIF
  1029.  
  1030. ;
  1031. ; pascal void SetHardDiskTimeout(UInt8 timeout)
  1032. ;
  1033.     IF ¬ GENERATINGCFM THEN
  1034.         ; parameters:
  1035.         ;    timeout         => D0
  1036.         Macro
  1037.         _SetHardDiskTimeout
  1038.             swap                D0
  1039.             move.w              #$0005,D0
  1040.             dc.w                $A09E
  1041.         EndM
  1042.     ELSE
  1043.         IMPORT_CFM_FUNCTION SetHardDiskTimeout
  1044.     ENDIF
  1045.  
  1046. ;
  1047. ; pascal Boolean HardDiskPowered(void )
  1048. ;
  1049.     IF ¬ GENERATINGCFM THEN
  1050.         ; returns:
  1051.         ;    Boolean         <= D0
  1052.         Macro
  1053.         _HardDiskPowered
  1054.             moveq               #6,D0
  1055.             dc.w                $A09E
  1056.         EndM
  1057.     ELSE
  1058.         IMPORT_CFM_FUNCTION HardDiskPowered
  1059.     ENDIF
  1060.  
  1061. ;
  1062. ; pascal void SpinDownHardDisk(void )
  1063. ;
  1064.     IF ¬ GENERATINGCFM THEN
  1065.         Macro
  1066.         _SpinDownHardDisk
  1067.             moveq               #7,D0
  1068.             dc.w                $A09E
  1069.         EndM
  1070.     ELSE
  1071.         IMPORT_CFM_FUNCTION SpinDownHardDisk
  1072.     ENDIF
  1073.  
  1074. ;
  1075. ; pascal Boolean IsSpindownDisabled(void )
  1076. ;
  1077.     IF ¬ GENERATINGCFM THEN
  1078.         ; returns:
  1079.         ;    Boolean         <= D0
  1080.         Macro
  1081.         _IsSpindownDisabled
  1082.             moveq               #8,D0
  1083.             dc.w                $A09E
  1084.         EndM
  1085.     ELSE
  1086.         IMPORT_CFM_FUNCTION IsSpindownDisabled
  1087.     ENDIF
  1088.  
  1089. ;
  1090. ; pascal void SetSpindownDisable(Boolean setDisable)
  1091. ;
  1092.     IF ¬ GENERATINGCFM THEN
  1093.         ; parameters:
  1094.         ;    setDisable      => D0
  1095.         Macro
  1096.         _SetSpindownDisable
  1097.             swap                D0
  1098.             move.w              #$0009,D0
  1099.             dc.w                $A09E
  1100.         EndM
  1101.     ELSE
  1102.         IMPORT_CFM_FUNCTION SetSpindownDisable
  1103.     ENDIF
  1104.  
  1105. ;
  1106. ; pascal OSErr HardDiskQInstall(HDQueueElement *theElement)
  1107. ;
  1108.     IF ¬ GENERATINGCFM THEN
  1109.         ; parameters:
  1110.         ;    theElement      => A0
  1111.         ; returns:
  1112.         ;    OSErr           <= D0
  1113.         Macro
  1114.         _HardDiskQInstall
  1115.             moveq               #10,D0
  1116.             dc.w                $A09E
  1117.         EndM
  1118.     ELSE
  1119.         IMPORT_CFM_FUNCTION HardDiskQInstall
  1120.     ENDIF
  1121.  
  1122. ;
  1123. ; pascal OSErr HardDiskQRemove(HDQueueElement *theElement)
  1124. ;
  1125.     IF ¬ GENERATINGCFM THEN
  1126.         ; parameters:
  1127.         ;    theElement      => A0
  1128.         ; returns:
  1129.         ;    OSErr           <= D0
  1130.         Macro
  1131.         _HardDiskQRemove
  1132.             moveq               #11,D0
  1133.             dc.w                $A09E
  1134.         EndM
  1135.     ELSE
  1136.         IMPORT_CFM_FUNCTION HardDiskQRemove
  1137.     ENDIF
  1138.  
  1139. ;
  1140. ; pascal void GetScaledBatteryInfo(short whichBattery, BatteryInfo *theInfo)
  1141. ;
  1142.     IF ¬ GENERATINGCFM THEN
  1143.         ; parameters:
  1144.         ;    whichBatterytheInfo=> D0
  1145.         ;    theInfo         => A0
  1146.         Macro
  1147.         _GetScaledBatteryInfo
  1148.             swap                D0
  1149.             move.w              #$000C,D0
  1150.             dc.w                $A09E
  1151.             move.l              D0,(A0)
  1152.         EndM
  1153.     ELSE
  1154.         IMPORT_CFM_FUNCTION GetScaledBatteryInfo
  1155.     ENDIF
  1156.  
  1157. ;
  1158. ; pascal void AutoSleepControl(Boolean enableSleep)
  1159. ;
  1160.     IF ¬ GENERATINGCFM THEN
  1161.         ; parameters:
  1162.         ;    enableSleep     => D0
  1163.         Macro
  1164.         _AutoSleepControl
  1165.             swap                D0
  1166.             move.w              #$000D,D0
  1167.             dc.w                $A09E
  1168.         EndM
  1169.     ELSE
  1170.         IMPORT_CFM_FUNCTION AutoSleepControl
  1171.     ENDIF
  1172.  
  1173. ;
  1174. ; pascal unsigned long GetIntModemInfo(void )
  1175. ;
  1176.     IF ¬ GENERATINGCFM THEN
  1177.         ; returns:
  1178.         ;    unsigned long   <= D0
  1179.         Macro
  1180.         _GetIntModemInfo
  1181.             moveq               #14,D0
  1182.             dc.w                $A09E
  1183.         EndM
  1184.     ELSE
  1185.         IMPORT_CFM_FUNCTION GetIntModemInfo
  1186.     ENDIF
  1187.  
  1188. ;
  1189. ; pascal void SetIntModemState(short theState)
  1190. ;
  1191.     IF ¬ GENERATINGCFM THEN
  1192.         ; parameters:
  1193.         ;    theState        => D0
  1194.         Macro
  1195.         _SetIntModemState
  1196.             swap                D0
  1197.             move.w              #$000F,D0
  1198.             dc.w                $A09E
  1199.         EndM
  1200.     ELSE
  1201.         IMPORT_CFM_FUNCTION SetIntModemState
  1202.     ENDIF
  1203.  
  1204. ;
  1205. ; pascal short MaximumProcessorSpeed(void )
  1206. ;
  1207.     IF ¬ GENERATINGCFM THEN
  1208.         ; returns:
  1209.         ;    short           <= D0
  1210.         Macro
  1211.         _MaximumProcessorSpeed
  1212.             moveq               #16,D0
  1213.             dc.w                $A09E
  1214.         EndM
  1215.     ELSE
  1216.         IMPORT_CFM_FUNCTION MaximumProcessorSpeed
  1217.     ENDIF
  1218.  
  1219. ;
  1220. ; pascal short CurrentProcessorSpeed(void )
  1221. ;
  1222.     IF ¬ GENERATINGCFM THEN
  1223.         ; returns:
  1224.         ;    short           <= D0
  1225.         Macro
  1226.         _CurrentProcessorSpeed
  1227.             moveq               #17,D0
  1228.             dc.w                $A09E
  1229.         EndM
  1230.     ELSE
  1231.         IMPORT_CFM_FUNCTION CurrentProcessorSpeed
  1232.     ENDIF
  1233.  
  1234. ;
  1235. ; pascal Boolean FullProcessorSpeed(void )
  1236. ;
  1237.     IF ¬ GENERATINGCFM THEN
  1238.         ; returns:
  1239.         ;    Boolean         <= D0
  1240.         Macro
  1241.         _FullProcessorSpeed
  1242.             moveq               #18,D0
  1243.             dc.w                $A09E
  1244.         EndM
  1245.     ELSE
  1246.         IMPORT_CFM_FUNCTION FullProcessorSpeed
  1247.     ENDIF
  1248.  
  1249. ;
  1250. ; pascal Boolean SetProcessorSpeed(Boolean fullSpeed)
  1251. ;
  1252.     IF ¬ GENERATINGCFM THEN
  1253.         ; parameters:
  1254.         ;    fullSpeed       => D0
  1255.         ; returns:
  1256.         ;    Boolean         <= D0
  1257.         Macro
  1258.         _SetProcessorSpeed
  1259.             swap                D0
  1260.             move.w              #$0013,D0
  1261.             dc.w                $A09E
  1262.         EndM
  1263.     ELSE
  1264.         IMPORT_CFM_FUNCTION SetProcessorSpeed
  1265.     ENDIF
  1266.  
  1267. ;
  1268. ; pascal short GetSCSIDiskModeAddress(void )
  1269. ;
  1270.     IF ¬ GENERATINGCFM THEN
  1271.         ; returns:
  1272.         ;    short           <= D0
  1273.         Macro
  1274.         _GetSCSIDiskModeAddress
  1275.             moveq               #20,D0
  1276.             dc.w                $A09E
  1277.         EndM
  1278.     ELSE
  1279.         IMPORT_CFM_FUNCTION GetSCSIDiskModeAddress
  1280.     ENDIF
  1281.  
  1282. ;
  1283. ; pascal void SetSCSIDiskModeAddress(short scsiAddress)
  1284. ;
  1285.     IF ¬ GENERATINGCFM THEN
  1286.         ; parameters:
  1287.         ;    scsiAddress     => D0
  1288.         Macro
  1289.         _SetSCSIDiskModeAddress
  1290.             swap                D0
  1291.             move.w              #$0015,D0
  1292.             dc.w                $A09E
  1293.         EndM
  1294.     ELSE
  1295.         IMPORT_CFM_FUNCTION SetSCSIDiskModeAddress
  1296.     ENDIF
  1297.  
  1298. ;
  1299. ; pascal void GetWakeupTimer(WakeupTime *theTime)
  1300. ;
  1301.     IF ¬ GENERATINGCFM THEN
  1302.         ; parameters:
  1303.         ;    theTime         => A0
  1304.         Macro
  1305.         _GetWakeupTimer
  1306.             moveq               #22,D0
  1307.             dc.w                $A09E
  1308.         EndM
  1309.     ELSE
  1310.         IMPORT_CFM_FUNCTION GetWakeupTimer
  1311.     ENDIF
  1312.  
  1313. ;
  1314. ; pascal void SetWakeupTimer(WakeupTime *theTime)
  1315. ;
  1316.     IF ¬ GENERATINGCFM THEN
  1317.         ; parameters:
  1318.         ;    theTime         => A0
  1319.         Macro
  1320.         _SetWakeupTimer
  1321.             moveq               #23,D0
  1322.             dc.w                $A09E
  1323.         EndM
  1324.     ELSE
  1325.         IMPORT_CFM_FUNCTION SetWakeupTimer
  1326.     ENDIF
  1327.  
  1328. ;
  1329. ; pascal Boolean IsProcessorCyclingEnabled(void )
  1330. ;
  1331.     IF ¬ GENERATINGCFM THEN
  1332.         ; returns:
  1333.         ;    Boolean         <= D0
  1334.         Macro
  1335.         _IsProcessorCyclingEnabled
  1336.             moveq               #24,D0
  1337.             dc.w                $A09E
  1338.         EndM
  1339.     ELSE
  1340.         IMPORT_CFM_FUNCTION IsProcessorCyclingEnabled
  1341.     ENDIF
  1342.  
  1343. ;
  1344. ; pascal void EnableProcessorCycling(Boolean enable)
  1345. ;
  1346.     IF ¬ GENERATINGCFM THEN
  1347.         ; parameters:
  1348.         ;    enable          => D0
  1349.         Macro
  1350.         _EnableProcessorCycling
  1351.             swap                D0
  1352.             move.w              #$0019,D0
  1353.             dc.w                $A09E
  1354.         EndM
  1355.     ELSE
  1356.         IMPORT_CFM_FUNCTION EnableProcessorCycling
  1357.     ENDIF
  1358.  
  1359. ;
  1360. ; pascal short BatteryCount(void )
  1361. ;
  1362.     IF ¬ GENERATINGCFM THEN
  1363.         ; returns:
  1364.         ;    short           <= D0
  1365.         Macro
  1366.         _BatteryCount
  1367.             moveq               #26,D0
  1368.             dc.w                $A09E
  1369.         EndM
  1370.     ELSE
  1371.         IMPORT_CFM_FUNCTION BatteryCount
  1372.     ENDIF
  1373.  
  1374. ;
  1375. ; pascal Fixed GetBatteryVoltage(short whichBattery)
  1376. ;
  1377.     IF ¬ GENERATINGCFM THEN
  1378.         ; parameters:
  1379.         ;    whichBattery    => D0
  1380.         ; returns:
  1381.         ;    Fixed           <= D0
  1382.         Macro
  1383.         _GetBatteryVoltage
  1384.             swap                D0
  1385.             move.w              #$001B,D0
  1386.             dc.w                $A09E
  1387.         EndM
  1388.     ELSE
  1389.         IMPORT_CFM_FUNCTION GetBatteryVoltage
  1390.     ENDIF
  1391.  
  1392. ;
  1393. ; pascal void GetBatteryTimes(short whichBattery, BatteryTimeRec *theTimes)
  1394. ;
  1395.     IF ¬ GENERATINGCFM THEN
  1396.         ; parameters:
  1397.         ;    whichBatterytheTimes=> D0
  1398.         ;    theTimes        => A0
  1399.         Macro
  1400.         _GetBatteryTimes
  1401.             swap                D0
  1402.             move.w              #$001C,D0
  1403.             dc.w                $A09E
  1404.         EndM
  1405.     ELSE
  1406.         IMPORT_CFM_FUNCTION GetBatteryTimes
  1407.     ENDIF
  1408.  
  1409. ;
  1410. ; pascal UInt8 GetDimmingTimeout(void )
  1411. ;
  1412.     IF ¬ GENERATINGCFM THEN
  1413.         ; returns:
  1414.         ;    UInt8           <= D0
  1415.         Macro
  1416.         _GetDimmingTimeout
  1417.             moveq               #29,D0
  1418.             dc.w                $A09E
  1419.         EndM
  1420.     ELSE
  1421.         IMPORT_CFM_FUNCTION GetDimmingTimeout
  1422.     ENDIF
  1423.  
  1424. ;
  1425. ; pascal void SetDimmingTimeout(UInt8 timeout)
  1426. ;
  1427.     IF ¬ GENERATINGCFM THEN
  1428.         ; parameters:
  1429.         ;    timeout         => D0
  1430.         Macro
  1431.         _SetDimmingTimeout
  1432.             swap                D0
  1433.             move.w              #$001E,D0
  1434.             dc.w                $A09E
  1435.         EndM
  1436.     ELSE
  1437.         IMPORT_CFM_FUNCTION SetDimmingTimeout
  1438.     ENDIF
  1439.  
  1440. ;
  1441. ; pascal void DimmingControl(Boolean enableSleep)
  1442. ;
  1443.     IF ¬ GENERATINGCFM THEN
  1444.         ; parameters:
  1445.         ;    enableSleep     => D0
  1446.         Macro
  1447.         _DimmingControl
  1448.             swap                D0
  1449.             move.w              #$001F,D0
  1450.             dc.w                $A09E
  1451.         EndM
  1452.     ELSE
  1453.         IMPORT_CFM_FUNCTION DimmingControl
  1454.     ENDIF
  1455.  
  1456. ;
  1457. ; pascal Boolean IsDimmingControlDisabled(void )
  1458. ;
  1459.     IF ¬ GENERATINGCFM THEN
  1460.         ; returns:
  1461.         ;    Boolean         <= D0
  1462.         Macro
  1463.         _IsDimmingControlDisabled
  1464.             moveq               #32,D0
  1465.             dc.w                $A09E
  1466.         EndM
  1467.     ELSE
  1468.         IMPORT_CFM_FUNCTION IsDimmingControlDisabled
  1469.     ENDIF
  1470.  
  1471. ;
  1472. ; pascal Boolean IsAutoSlpControlDisabled(void )
  1473. ;
  1474.     IF ¬ GENERATINGCFM THEN
  1475.         ; returns:
  1476.         ;    Boolean         <= D0
  1477.         Macro
  1478.         _IsAutoSlpControlDisabled
  1479.             moveq               #33,D0
  1480.             dc.w                $A09E
  1481.         EndM
  1482.     ELSE
  1483.         IMPORT_CFM_FUNCTION IsAutoSlpControlDisabled
  1484.     ENDIF
  1485.  
  1486. ;
  1487. ; pascal OSErr PMgrStateQInstall(PMgrQueueElement *theElement)
  1488. ;
  1489.     IF ¬ GENERATINGCFM THEN
  1490.         ; parameters:
  1491.         ;    theElement      => A0
  1492.         ; returns:
  1493.         ;    OSErr           <= D0
  1494.         Macro
  1495.         _PMgrStateQInstall
  1496.             moveq               #34,D0
  1497.             dc.w                $A09E
  1498.         EndM
  1499.     ELSE
  1500.         IMPORT_CFM_FUNCTION PMgrStateQInstall
  1501.     ENDIF
  1502.  
  1503. ;
  1504. ; pascal OSErr PMgrStateQRemove(PMgrQueueElement *theElement)
  1505. ;
  1506.     IF ¬ GENERATINGCFM THEN
  1507.         ; parameters:
  1508.         ;    theElement      => A0
  1509.         ; returns:
  1510.         ;    OSErr           <= D0
  1511.         Macro
  1512.         _PMgrStateQRemove
  1513.             moveq               #35,D0
  1514.             dc.w                $A09E
  1515.         EndM
  1516.     ELSE
  1517.         IMPORT_CFM_FUNCTION PMgrStateQRemove
  1518.     ENDIF
  1519.  
  1520. ;
  1521. ; pascal OSErr UpdateSystemActivity(UInt8 activity)
  1522. ;
  1523.     IF ¬ GENERATINGCFM THEN
  1524.         ; parameters:
  1525.         ;    activity        => D0
  1526.         ; returns:
  1527.         ;    OSErr           <= D0
  1528.         Macro
  1529.         _UpdateSystemActivity
  1530.             swap                D0
  1531.             move.w              #$0024,D0
  1532.             dc.w                $A09E
  1533.         EndM
  1534.     ELSE
  1535.         IMPORT_CFM_FUNCTION UpdateSystemActivity
  1536.     ENDIF
  1537.  
  1538. ;
  1539. ; pascal OSErr DelaySystemIdle(void )
  1540. ;
  1541.     IF ¬ GENERATINGCFM THEN
  1542.         ; returns:
  1543.         ;    OSErr           <= D0
  1544.         Macro
  1545.         _DelaySystemIdle
  1546.             moveq               #37,D0
  1547.             dc.w                $A09E
  1548.         EndM
  1549.     ELSE
  1550.         IMPORT_CFM_FUNCTION DelaySystemIdle
  1551.     ENDIF
  1552.  
  1553. ;
  1554. ; pascal OSErr GetStartupTimer(StartupTime *theTime)
  1555. ;
  1556.     IF ¬ GENERATINGCFM THEN
  1557.         ; parameters:
  1558.         ;    theTime         => A0
  1559.         ; returns:
  1560.         ;    OSErr           <= D0
  1561.         Macro
  1562.         _GetStartupTimer
  1563.             moveq               #38,D0
  1564.             dc.w                $A09E
  1565.         EndM
  1566.     ELSE
  1567.         IMPORT_CFM_FUNCTION GetStartupTimer
  1568.     ENDIF
  1569.  
  1570. ;
  1571. ; pascal OSErr SetStartupTimer(StartupTime *theTime)
  1572. ;
  1573.     IF ¬ GENERATINGCFM THEN
  1574.         ; parameters:
  1575.         ;    theTime         => A0
  1576.         ; returns:
  1577.         ;    OSErr           <= D0
  1578.         Macro
  1579.         _SetStartupTimer
  1580.             moveq               #39,D0
  1581.             dc.w                $A09E
  1582.         EndM
  1583.     ELSE
  1584.         IMPORT_CFM_FUNCTION SetStartupTimer
  1585.     ENDIF
  1586.  
  1587. ;
  1588. ; pascal OSErr GetLastActivity(ActivityInfo *theActivity)
  1589. ;
  1590.     IF ¬ GENERATINGCFM THEN
  1591.         ; parameters:
  1592.         ;    theActivity     => A0
  1593.         ; returns:
  1594.         ;    OSErr           <= D0
  1595.         Macro
  1596.         _GetLastActivity
  1597.             moveq               #40,D0
  1598.             dc.w                $A09E
  1599.         EndM
  1600.     ELSE
  1601.         IMPORT_CFM_FUNCTION GetLastActivity
  1602.     ENDIF
  1603.  
  1604.     ENDIF
  1605.     ENDIF ; __POWER__ 
  1606.  
  1607.